home *** CD-ROM | disk | FTP | other *** search
- property my, x, IncrementValue, XIncrement, RandomCounter, counter
-
- on beginSprite me
- Initialize(me)
- end
-
- on exitFrame me
- update(me)
- end
-
- on Initialize me
- my = me.spriteNum
- sprite(my).locH = random(800)
- sprite(my).blend = 0
- RandomCounter = random(900)
- counter = 1
- IncrementValue = random(4)
- RandomX = random(2)
- if RandomX = 1 then
- XSign = 1
- else
- XSign = -1
- end if
- XIncrement = IncrementValue * XSign
- x = sprite(my).locH
- end
-
- on update me
- if sprite(my).blend < 30 then
- sprite(my).blend = sprite(my).blend + 1
- end if
- if counter < RandomCounter then
- if (sprite(my).locH > -50) and (sprite(my).locH < 850) then
- x = x + XIncrement
- sprite(my).locH = x
- counter = counter + 1
- else
- if (sprite(my).locH <= -50) or (sprite(my).locH >= 850) then
- XIncrement = -XIncrement
- x = x + XIncrement
- sprite(my).locH = x
- end if
- end if
- else
- if counter = RandomCounter then
- RandomCounter = random(900)
- counter = 1
- end if
- end if
- end
-